﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for cls_tbHOADON_KHACHHANGKHAC
/// </summary>
public class cls_tbHOADON_KHACHHANGKHAC
{
	public cls_tbHOADON_KHACHHANGKHAC()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public static DataTable GetAll()
    {
        DataTable dt = new DataTable();
        DatabaseConnect connect = new DatabaseConnect();
        // Tham so
        //SqlParameter[] para = new SqlParameter[1];
        //para[0] = new SqlParameter("@F_STT", F_STT);
        try
        {
            dt = connect.GetSelectCommand("tbHOADON_KHACHHANGKHAC_GetAll", null);
        }
        catch { }
        return dt;
    }
    public static string Insert(string HOTENNGUOIMUAHANG, string TENDONVI, string DIACHI, string TAIKHOAN, string MASOTHUE)
    {
        DatabaseConnect connect = new DatabaseConnect();
        // Tham so
        object[] values = { HOTENNGUOIMUAHANG,TENDONVI,DIACHI,TAIKHOAN,MASOTHUE };
        string[] parameters = { "@HOTENNGUOIMUAHANG", "@TENDONVI", "@DIACHI", "@TAIKHOAN", "@MASOTHUE" };
        SqlParameter[] para = new SqlParameter[parameters.Length];
        for (int i = 0; i < parameters.Length; i++)
        {
            para[i] = new SqlParameter(parameters[i], values[i]);
        }
        try
        {
            connect.ExecuteQuery("tbHOADON_KHACHHANGKHAC_Insert", para);
            return "OK";
        }
        catch
        {
            return "ERR";
        }
    }
}